package com.slipper.system.flow.controller;

import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.slipper.system.flow.bo.FlowBO;
import com.slipper.system.flow.service.FlowService;
import com.slipper.util.ResultUtil;

/**
 * 流程信息表
 */
@RestController
@RequestMapping("/system/flow")
public class FlowController {
    @Resource
    private FlowService flowService;
    
    @PostMapping("/queryBy")
    public String queryBy(@RequestBody FlowBO bo) {
        return ResultUtil.successResult(flowService.queryBy(bo.getId()));
    }
    
    @PostMapping("/queryPage")
    public String queryPage(@RequestBody FlowBO bo) {
        return ResultUtil.successResult(flowService.queryPage(bo));
    }

    @PostMapping("/queryList")
    public String queryList(@RequestBody FlowBO bo) {
        return ResultUtil.successResult(flowService.queryList(bo));
    }

    @PostMapping("/save")
    public String save(@RequestBody FlowBO bo) {
        return flowService.save(bo);
    }
    
    @PostMapping("/saveFlowData")
    public String saveFlowData(@RequestBody FlowBO bo) {
        return flowService.saveFlowData(bo);
    }

    @PostMapping("/delete")
    public String delete(@RequestBody FlowBO bo) {
        return ResultUtil.deleteResult(flowService.delete(bo));
    }
}
